<layout name="Public/layout"/>
{:jumps($infos['authority'],CONTROLLER_NAME)}

        <script language="javascript" type="text/javascript">
            function deleteRole() {
                var r = window.confirm("确定要删除此角色吗？");
                document.getElementById("operate_result_info").style.display = "block";
            }
        </script>

        
        <!--主要区域开始-->
        <div id="main">
            <form action="" method="">
                <!--查询-->
                <div class="search_add">
                    <input type="button" value="增加" class="btn_add" onclick="location.href='{:U('Privilege/add')}';" />
                </div>  
                
                
                <!--数据区域：用表格展示数据-->     
                <div id="data">                      
                    <table id="datalist">
                        <tr>                            
                            <th>权限 ID</th>
                            <th>权限名称</th>
                            <th>控制器</th>
                            <th>模块</th>
                            <th>方法</th>
                            <th class="td_modi"></th>
                        </tr>    
<!--遍历数据 start-->                                                    
<volist name="res['res']" id='vo' key='k'>                                            
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.controller}</td>
                            <td>{$vo.module}</td>
                            <td>{$vo.action}</td>
<if condition="$vo['id'] eq 1">
                            <td> --- </td>
    <else /> 
                            <td>
                                <input type="button" value="修改" class="btn_modify" onclick="location.href='__CONTROLLER__/edit/id/{$vo.id}';"/>
                                <input type="button" value="删除" class="btn_delete" onclick="deletes('__CONTROLLER__/delete/id/{$vo.id}');" />
                            </td>    
</if>

                        </tr>
</volist>    
<!--遍历数据 end-->

                    </table>
                </div> 
                <!--分页-->
                <div id="pages">
                       {$res['page']}
                </div>
            </form>
        </div>
        <!--主要区域结束-->
 
<script type="text/javascript">
//删除
function deletes(obj){
      
    layer.confirm('你确定真的要删除此权限？', {icon: 3, title:'提示'}, function(index){
        if(index){    

            $.get(obj, function(data){

                //判断是否删除成功！
                if(data.status==0){
                    layer.msg(data.info,{icon: 5});
                }else{
                    layer.msg(data.info,{icon: 6});

                    //延迟跳转
                    setTimeout(function () {
                        location.href = "{:U('Privilege/index')}";
                    }, {:C('AJAX_TIME')});

                }

            });


        }  
      layer.close(index);
    });    
        
}            
</script>        
        
<script type="text/javascript">
    $(function(){
        //点击之后的图标
        $('.role_off').addClass('role_on').removeClass('role_off');
    });  
</script>
<style type="text/css">
    .empty{
        font-weight:bold;
    }
</style>
